//////////////////////////////////////////////////////////////////////
//!\file StatusBar.cpp
//!\brief Subclassed QStatusBar.
//!\author timmsusa@googlemail.com
//////////////////////////////////////////////////////////////////////


#include "StatusBar.hpp"

StatusBar::StatusBar(QStatusBar *parent) :
    QStatusBar(parent),
    m_ProgressBar(new QProgressBar),
    m_ProgressBarCount(0),
    m_ProgressBarMax(0),
    m_LabelLeft(new QLabel)
{
    addWidget(m_ProgressBar);
    //m_ProgressBar->setAttribute(Qt::WA_QuitOnCloseDeleteOnClose); // is that ok?
    m_ProgressBar->hide();
    addWidget(m_LabelLeft);
}

void StatusBar::setLabelTxt(const QString& txt)
{
    m_LabelLeft->setText(txt);

  //  showMessage(txt);
}

void StatusBar::showProgressBar()
{
    m_ProgressBar->show();
}

void StatusBar::hideProgressBar()
{
    m_ProgressBar->hide();
}

void StatusBar::setProgressBar(int perc)
{
    m_ProgressBar->setValue(perc);
}

void StatusBar::setProgressBarMax(int maxVal)
{
    m_ProgressBar->setMaximum(maxVal);
    m_ProgressBarMax = maxVal;
}

int StatusBar::getProgressBarMax()const
{
    return m_ProgressBarMax;
}
